package com.hangjiang.gulidear.model;

import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * Problem entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "problem", catalog = "sqm")
public class Problem extends BaseEntity {

	// Fields

	private String probemId;
	private Project project;
	private User userByExeUserId;
	private User userByCuserId;
	private String problemTitle;
	private Date deadline;
	private Timestamp createTime;
	private String problemDescribe;
	private Integer status;

	// Constructors

	/** default constructor */
	public Problem() {
	}

	/** full constructor */
	public Problem(Project project, User userByExeUserId, User userByCuserId,
			String problemTitle, Date deadline, Timestamp createTime,
			String problemDescribe, Integer status) {
		this.project = project;
		this.userByExeUserId = userByExeUserId;
		this.userByCuserId = userByCuserId;
		this.problemTitle = problemTitle;
		this.deadline = deadline;
		this.createTime = createTime;
		this.problemDescribe = problemDescribe;
		this.status = status;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "probemId", unique = true, nullable = false, length = 32)
	public String getProbemId() {
		return this.probemId;
	}

	public void setProbemId(String probemId) {
		this.probemId = probemId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projId")
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "exeUserId")
	public User getUserByExeUserId() {
		return this.userByExeUserId;
	}

	public void setUserByExeUserId(User userByExeUserId) {
		this.userByExeUserId = userByExeUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cUserId")
	public User getUserByCuserId() {
		return this.userByCuserId;
	}

	public void setUserByCuserId(User userByCuserId) {
		this.userByCuserId = userByCuserId;
	}

	@Column(name = "problemTitle", length = 30)
	public String getProblemTitle() {
		return this.problemTitle;
	}

	public void setProblemTitle(String problemTitle) {
		this.problemTitle = problemTitle;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "deadline", length = 0)
	public Date getDeadline() {
		return this.deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	@Column(name = "createTime", length = 0)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "problemDescribe", length = 200)
	public String getProblemDescribe() {
		return this.problemDescribe;
	}

	public void setProblemDescribe(String problemDescribe) {
		this.problemDescribe = problemDescribe;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}